package com.moxiao.yfjh.module.blind.dal.mysql.constellationspeech;

import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import com.moxiao.yfjh.module.blind.dal.dataobject.constellationspeech.ConstellationSpeechDO;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.blind.controller.admin.constellationspeech.vo.*;

/**
 * 相亲会员录音回复 Mapper
 *
 * @author mx
 */
@Mapper
public interface ConstellationSpeechMapper extends BaseMapperX<ConstellationSpeechDO> {

    default PageResult<ConstellationSpeechDO> selectPage(ConstellationSpeechPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConstellationSpeechDO>()
                .eqIfPresent(ConstellationSpeechDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ConstellationSpeechDO::getTestId, reqVO.getTestId())
                .eqIfPresent(ConstellationSpeechDO::getVoiceFiles, reqVO.getVoiceFiles())
                .betweenIfPresent(ConstellationSpeechDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ConstellationSpeechDO::getId));
    }

    default List<ConstellationSpeechDO> selectList(ConstellationSpeechExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ConstellationSpeechDO>()
                .eqIfPresent(ConstellationSpeechDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ConstellationSpeechDO::getTestId, reqVO.getTestId())
                .eqIfPresent(ConstellationSpeechDO::getVoiceFiles, reqVO.getVoiceFiles())
                .betweenIfPresent(ConstellationSpeechDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ConstellationSpeechDO::getId));
    }

}
